package com.springcloud.tools.conf;

import com.springcloud.tools.interceptor.IdempotentInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author fuc
 * @create 2020-08-19
 */
//@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

  @Autowired IdempotentInterceptor idempotentInterceptor;

  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(idempotentInterceptor).addPathPatterns("/**");
  }
}
